package com.zhuang.work0430.util;

import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;

/**
 * @className: Demo
 * @description: 类描述
 * @author: tian
 * @date: 2021/4/22 12:15
 */
public class Demo {
    public static void main(String[] args) {
        //加密方式
        String hashAlgorithmName = "MD5";
        //加密次数
        int hashInteractions = 15;
        //盐值
        String salt = "miao";
        //原密码
        String pwd = "123";
        //将得到的result放到数据库中就行了。
        String result = new SimpleHash(hashAlgorithmName, pwd, ByteSource.Util.bytes("admin"), hashInteractions).toHex();
        System.out.println(result);
    }
}
